﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageMain.Master" AutoEventWireup="true" CodeBehind="PayMonthlyBills.aspx.cs" Inherits="PersonalFinanceManager.Website.BillsTransactionTypes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
    <div class="content">
        <h2>Месечни сметки</h2>
        <hr />
        
        

        <div class="mainbar">
                <div style="float:right;padding-right:10px;width:100%;">
                    <asp:Panel runat="server" ID="pnlSearch" GroupingText="Пребарување" DefaultButton="btnSearch">
                        <asp:TextBox ID="txtSearch" runat="server" Width="200px" />&nbsp;&nbsp;
                        <span>Датум Од:</span>&nbsp;<asp:TextBox runat="server" ID="txtSearchDateFrom" Width="100px" CssClass="date" />&nbsp;
                        <span>Датум До:</span>&nbsp;<asp:TextBox runat="server" ID="txtSearchDateTo" Width="100px" CssClass="date" />
                        
                        <br />
                        <asp:Button ID="btnSearch" runat="server" Text="Барај" onclick="btnSearch_Click" />&nbsp;
                        <asp:Button ID="btnResetSearch" runat="server" Text="Ресет" onclick="btnResetSearch_Click" />
                    </asp:Panel>
                </div>
                <div class="clr"></div>

                <div>
                <p class="post-data">
                    <asp:GridView runat="server" ID="gvBillsTransactions" AutoGenerateColumns="false"  DataKeyNames="ID"
                        onrowdeleting="gvBillsTransactions_RowDeleting" 
                        onselectedindexchanged="gvBillsTransactions_SelectedIndexChanged">
                        <EmptyDataTemplate>
                            -- Нема податоци --
                        </EmptyDataTemplate>


                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Назив" ItemStyle-Width="170px" ItemStyle-HorizontalAlign="Left" />
                            <asp:BoundField DataField="Money" DataFormatString="{0:0.00}" HeaderText="Пари (ден.)" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />
                            <asp:BoundField DataField="DateOfBillsTransaction" DataFormatString="{0:dd.MM.yyyy HH:mm}" HeaderText="Датум уплата" ItemStyle-Width="125px" ItemStyle-HorizontalAlign="Center" />
                            <asp:BoundField DataField="Description" HeaderText="Опис" ItemStyle-Width="110px" ItemStyle-HorizontalAlign="Left" />

                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ID="btnEdit" CommandName="Select" Text="промени" />
                                </ItemTemplate>
                                <ItemStyle Width="65px" ForeColor="Blue" HorizontalAlign="Center" />
                            </asp:TemplateField>

                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ID="btnDelete" CommandName="Delete" Text="избриши"
                                        OnClientClick='<%# "return confirm(\"Избриши запис? \")" %>' />
                                </ItemTemplate>
                                <ItemStyle Width="60px" ForeColor="Red" HorizontalAlign="Center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                    <span>
                        <b>Број на записи:</b>&nbsp;
                        <asp:Label runat="server" ID="lblTotalCount" />
                    </span>
                </p>
                <div style="float:right;margin-right:10px;">
                    <table>
                        <tr>
                            <td style="font-weight:bold;width:95px;">Датум Од:</td>
                            <td style="text-align:right;"><asp:Label ID="lblTotalDateFrom" runat="server" Width="120px" /></td>
                        </tr>
                        <tr>
                            <td style="font-weight:bold;width:95px;">Датум До:</td>
                            <td style="text-align:right;"><asp:Label ID="lblTotalDateTo" runat="server" Width="120px" /></td>
                        </tr>
                        <tr>
                            <td style="font-weight:bold;width:95px;font-size:15pt;">Вкупно:</td>
                            <td style="text-align:right;"><asp:Label ID="lblTotalMoney" runat="server" Width="120px" Font-Size="15px" /></td>
                        </tr>
                    </table>
                </div>
                <div class="clr"></div>

                </div>
        </div>




        <div class="sidebar">
            <div class="gadget">
                <asp:Panel ID="pnlBillsTransactions" runat="server" 
                    GroupingText="" DefaultButton="btnInsert" >
                    <table style="width:100%">
                        <tr>
                            <td>Назив:</td>
                            <td><asp:TextBox runat="server" ID="txtName" Width="130px" /></td>
                        </tr>
                        <tr>
                            <td>Пари:</td>
                            <td><asp:TextBox runat="server" ID="txtMoney" Width="130px" /></td>
                        </tr>
                        <tr>
                            <td>Датум уплата:</td>
                            <td><asp:TextBox runat="server" ID="txtDateOfBillsTransaction" Width="130px" CssClass="date" /></td>
                        </tr>
                        <tr>
                            <td>Време уплата:</td>
                            <td>
                                <asp:DropDownList runat="server" ID="ddlHour" Width="65px" />
                                <asp:DropDownList runat="server" ID="ddlMinute" Width="65px" />
                            </td>
                        </tr>
                        <tr>
                            <td>Опис:</td>
                            <td><asp:TextBox runat="server" ID="txtDescription" Rows="3" TextMode="MultiLine" Width="130px" /></td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <div style="float:right;padding-top:10px;">
                                    <asp:Button runat="server" ID="btnInsert" Text="Внеси" ValidationGroup="group1" Font-Bold="true"
                                        onclick="btnInsert_Click" />
                                    <asp:Button runat="server" ID="btnUpdate" Text="Измени" ValidationGroup="group1" Font-Bold="true"
                                        onclick="btnUpdate_Click" />
                                    &nbsp;
                                    <asp:Button runat="server" ID="btnCancel" Text="Откажи" 
                                        onclick="btnCancel_Click" />
                                </div>
                            </td>
                        </tr>
                    </table>

                    <div>
                        <ul style="list-style-type:disc;margin-left:20px;">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="group1" Display="Dynamic" ControlToValidate="txtName" Text="<li>Полето 'Назив' е задолжително</li>" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ValidationGroup="group1" Display="Dynamic" ControlToValidate="txtMoney" Text="<li>Полето 'Пари' е задолжително</li>" />
                            <asp:RegularExpressionValidator ID="regular2" runat="server" ValidationGroup="group1" Display="Dynamic" ErrorMessage="<li>Полето 'Пари' не е во правилен формат [само броеви се дозволени]</li>"
                                ControlToValidate="txtMoney" ValidationExpression="(^\d+$)" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ValidationGroup="group1" Display="Dynamic" ControlToValidate="txtDateOfBillsTransaction" Text="<li>Полето 'Датум уплата' е задолжително</li>" />
                            <asp:RegularExpressionValidator ID="regular1" runat="server" ValidationGroup="group1" Display="Dynamic" ErrorMessage="<li>Полето 'Датум уплата' не е во правилен формат [dd.mm.yyyy]</li>"
                                ControlToValidate="txtDateOfBillsTransaction" ValidationExpression="^(0[1-9]|[12][0-9]|3[01])[- \.](0[1-9]|1[012])[- \.](19|20)\d\d$" />
                        </ul>
                    </div>
                </asp:Panel>
            </div>
        </div>
        <div class="clr"></div>
    </div>
</asp:Content>
